Field of the Invention
The present invention relates to a focus detection apparatus and method, and an image capturing apparatus including a focus detection apparatus.
Description of the Related Art
Conventionally, as a focus detection apparatus used in an optical device, such as a single-lens reflex camera, there is a focus detection apparatus that adapts the phase difference detection method. In this method, a pair of sensors perform photoelectric conversion on a pair of images of a subject formed by light that has transmitted through different pupil regions of an imaging lens, a phase difference between image signals output from the pair of sensors is obtained, and a defocus amount of the imaging lens is detected from the phase difference. In the phase difference detection method, it is known that if a degree of coincidence between the pair of subject images is low or if the contrast of the subject images is low, the result of the correlation operation deviates from an actual value. Accordingly, it is considered that reliability is high if a degree of coincidence between the pair of subject images is high, or if the contrast of the subject images is high. Therefore, it is also known that high precision focus detection can be performed by using a defocus amount of image signals with high reliability.
Japanese Patent Laid-Open No. 2007-52072 discloses a technique for performing high precision focus detection by selecting a specific focus detection region based on the degree of coincidence and the number of edges of a pair of subject images, and at least one of sharpness and a contrast ratio of the subject images.
Further, Japanese Patent Laid-Open No. 8-15604 disclose to divide a pair of line sensors into a plurality of blocks, and perform focus control based on a calculation result of image signals output from a block or blocks whose reliability values that evaluate the degree of coincidence of a pair of images satisfy a predetermined condition. In this manner, it is possible to realize focus detection with high accuracy while eliminating an effect of near/far conflict.
However, even if the techniques disclosed in Japanese Patent Laid-Open Nos. 2007-52072 and 8-15604 are used, there are still cases where the result of correlation operation deviates from an actual value, and consequently a defocused image is obtained due to the detection error. The causes of the detection error include inverse light transport and ghost for example, and the detection error occurs when a light which is not expected is incident on line sensors and the subject images are deformed. The degree of coincidence between the signals of deformed images is low, and the result of correlation operation tends to be unreliable.
As the degree of coincidence between two images is used to determine the reliability of the images in the conventional techniques, it is common to apply a digital filtering process of eliminating DC components of the two images in order to increase the degree of coincidence between the two images and eliminate a low frequency component in order to enhance the edge portions. However, the deformation of the image signals caused by the inverse light transport and ghost is rounded off by the digital filtering process. As a result, the calculated reliability of the subject images may be improved in spite that the degree of coincidence between two subject images actually deteriorates due to an effect of inverse light transport and ghost and the focus detection result is uncertain.
Subsequently, focus control is performed despite that the result of the correlation operation of the image signals is actually unreliable, and a defocused image is obtained as a result.